<script setup>
	import {
		RouterView
	} from 'vue-router'
	
	import { useRoute } from 'vue-router';
	const route = useRoute()
	
</script>

<template>
	<router-view v-slot="{ Component }">
		<!-- 按需缓存   -->
	<!-- 如果meta里定义的信息  缓存为不缓存  -->
	<component  :key="route.name" v-if="route.meta.cache===false" :is="Component"></component>
	<!-- keep-alive里的是缓存的 -->
	  <keep-alive>
	    <component :key="route.name" v-if="route.meta.cache!==false"  :is="Component" />
	  </keep-alive>
	</router-view>
</template>

<style scoped>

</style>